<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>选择楼层</title>
	<link rel="stylesheet" href="../../resource/weuimin.css" />
	<script src="../../template/js/jquery.js"></script>
	<script type="text/javascript" src="../../script/constants.js"></script>
	<script type="text/javascript" charset="UTF-8" src="../../script/naes.js"></script>
	<script src="../../script/api.js"></script>
    <style>
	 body {
	        margin: 0;
	 		padding: 0;
	}
	td {
	   text-align:center;
	}
    </style>
</head>
<body style="background: #f1f1f1;">
<header id="statusBar">
        <div style="height:75px;background: #298cb4;display: table;width: 100%;">
           <div style="height:50px;margin-top: 25px;line-height: 50px;color: #ffffff;background: #1e6887;">
               <div style="z-index: 999;margin-left: 10px;position: absolute;" onclick="api.closeWin();">
	           返回
	           </div>
	           <div style="text-align: center;font-weight:bold;width: 100%;" id="hotel_name">
	           
	           </div>
           </div>
        </div>
	</header>

<div style="background: #ffffff;width: 100%;margin: 0 auto;display: table;padding-top: 20px;margin-bottom: 20px;">
		   <div>
		      <div id="roomTp" style="text-align: center;height: 40px;line-height: 40px;font-weight:bold;font-size: 20px;">
		         
		      </div>
		      <div id="hotel_pic" style="height:200px;width:70%;margin: 0 auto;">
		         
		      </div>
		      <div>
		         <table style="margin: 0 auto;width: 80%;" cellspacing="5">
		         <tr>
		          <td style="width: 25%;">双人床</td><td style="width: 25%;">有窗</td><td style="width: 25%;">含单早</td><td style="width: 25%;">wifi</td>
		         </tr>
		         </table>
		      </div>
		   </div>
		   <div>
		   </div>
</div>

   <!-- <div class="slider_wrap">  
        <div id="pics" class="slider_content">  
            
        </div>  
    </div>  -->
	<div id="loadingToast" style="display:none;">
		<div class="weui-mask_transparent"></div>
		<div class="weui-toast">
			<i class="weui-loading weui-icon_toast"></i>
			<p class="weui-toast__content">数据加载中...</p>
		</div>
	</div>
	<div class="buildings" >
		<p style="text-align: center;color: #005DA9;">点击建筑图标进入选择楼层和房间</p>
		<div id="lcxx"  style="width: 100%;height: auto;">
	
             
		</div>
		
	</div>
</body>


<script type="text/javascript">
    var stDate = "";
    var edDate = "";
	apiready = function(){
		stDate = api.pageParam.stDate;
		edDate = api.pageParam.edDate;
		var id = api.pageParam.id;
		var name = api.pageParam.name; 
		var typeid = api.pageParam.typeid; 
		$("#roomTp").html(name);
		$("#loadingToast").show();
        var callback = function(ret, err){
        	var data = eval("("+ret.list+")");
        	var json=JSON.stringify(data);
        	console.log(JSON.stringify(ret));
        	var pic = new Array();
        	for(var k=0;k<data.picUrl.length;k++){
        	   pic.push(data.picUrl[k].URL);
        	}
        	var html = "";
//      	if(pic.length<3){
//      		for(var i=0;i<=(3-pic.length);i++){
//					pic.push(pic[i]);
//					
//      		}	
//      		for(var i=0;i<pic.length;i++){
//      			html += '<div class="slider_item">'+  
//                			'<img src="'+pic[i]+'" alt="">'+  
//            			'</div>';
//      		}
//      	}else{
//      		for(var i=0;i<pic.length;i++){
//      			html += '<div class="slider_item">'+  
//                			'<img src="'+pic[i]+'" alt="">'+  
//            			'</div>';
//      		}
//      	}

            var offset = $api.offset($api.dom('#hotel_pic'));
            var height = $("#hotel_pic").height();
            var width = $("#hotel_pic").width();
            var UIScrollPromptView = api.require('UIScrollPromptView');
				UIScrollPromptView.open({
				    rect: {
				        x: offset.l,
				        y: offset.t,
				        w: width,
				        h: height
				    },
				    data: {
				        paths: pic,
				        captions: [],
				        prompts: []
				    },
				    styles: {
				        caption: {
				            height: 35,
				            color: '#E0FFFF',
				            size: 13,
				            bgColor: '#696969',
				            position: 'bottom'
				        },
				        indicator: {
				            align: 'center',
				            color: '#FFFFFF',
				            activeColor: '#298cb4'
				        },
				        prompt: {
				            button: {
				                normal: '',
				                highlight: '',
				                x: 0,
				                y: 100,
				                w: 60,
				                h: 40
				            },
				            x: 0,
				            y: 50,
				            w: 160,
				            h: 90,
				            contentMode: 'scaleToFill',
				            animation: true
				        }
				    },
				    placeholderImg: '',
				    contentMode: 'scaleToFill',
				    interval: 3,
				    fixedOn: '',
				    loop: true,
				    fixed: false
				}, function(ret) {
				    if (ret) {
				        //alert(JSON.stringify(ret));
				    }
				});
        	
        	var pics = document.getElementById("pics");
        	$api.html(pics, html);
        	var mainInfo = document.getElementById('mainInfo');
        	var jstitle = document.getElementById('hotel_name');
        	$("#mainInfo").text(data.descr);
        	$("#hotel_name").text(data.name);
        
			var jddz = $("#jstitle").text();
			

        	var html="";
        	var thisHtml="";
        	var twoHtml="";
        	//展示酒店建筑栋数		
       		if(data.list.length>0){
       			for(var i=1;i<=data.list.length;i++){
       			    if(data.list[i-1].COUNT > 0){
    			    html += '<div style="width:30%;float: left;margin-left:3%;margin-top:10px;" onclick=openRooms("'+data.list[i-1].JZID+'")>'
    			    + '<div><img src="../../image/jztb2.png" style="width:100%;"/></div>'
    			    + '<div style="text-align: center;">'+data.list[i-1].JZMC+'</div></div>';
    			    }
    				
    			}
        		$('#lcxx').html(html);
        	
       		}
       		$("#loadingToast").hide(); 	
       	}
	    var parameter = {"id":id,"typeid":typeid};
	    apiAjax(JSON.stringify(parameter),url.jddetail,callback);
	};
	function openRooms(jzid){

		
		var jstitle = document.getElementById('jstitle');
		var floor = document.getElementById('floor');
		var floors = $("#floor").text();
		var title = $("#jstitle").text();
		var name = api.pageParam.name;
		var xzdate = api.pageParam.xzdate;
		api.openWin({
	        name: 'select_room',
	        url: './select_room.html',
	        pageParam:{
	        	title:title,
	        	jzid:jzid,
	        	name:name,
	        	xzdate:xzdate,
	        	stDate:stDate,
	        	edDate:edDate
	        }
        });
        
	}
	function getNowFormatDate() {

   		var now = new Date();  
		//alert(now.getDate()+'-'+now.getMonth());  
		//格式化日，如果小于9，前面补0  
		var day = ("0" + now.getDate()).slice(-2);  
		//格式化月，如果小于9，前面补0  
		var month = ("0" + (now.getMonth() + 1)).slice(-2);  
		//拼装完整日期格式  
		var today = now.getFullYear()+"-"+(month)+"-"+(day) ;  
		//完成赋值  
		return today; 
        
	}
	//打开全屏地图
	function openMap(){
		var name = $("#jstitle").text();
		
		api.openWin({
	        name: 'baidumap',
	        url: './baidumap.html',
	        pageParam:{
	        	name:name
	        }
        });
	}	
</script>
</html>